<template>
    <div>
        <div v-if="MuchShow==false" style="padding-top:20px;margin-left:40px">


<!--            <div class="account_item">-->
<!--                <span class="account_item_title">账户余额:</span>-->
<!--                <span class="account_item_content">{{getBalanceAmount}}</span>-->
<!--                <span class="account_item_titleBotton" @click="capitalClick">资金流水</span>-->
<!--            </div>-->
<!--            <div style="width:100%;border-bottom:1px solid #E4E7ED;margin-bottom:30px"></div>-->
<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">账号类型:</span>-->
<!--                <span class="account_item_content">{{form.bankType|mchTypeFormatter}}</span>-->
<!--                <span class="account_item_titleBotton" @click="updateBrokerageClick">设置</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item" v-if="form.bankType != 2">-->
<!--                <span class="account_item_title">开户银行:</span>-->
<!--                <span class="account_item_content">{{form.bankId|bankIDtype}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">{{form.bankType == 2?'支付宝号:':'银行账号:'}}</span>-->
<!--                <span class="account_item_content">{{form.bankNum==null||form.bankNum==""?'无':form.bankNum}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">开户名称:</span>-->
<!--                <span class="account_item_content">{{form.bankName==null||form.bankName==""?'无':form.bankName}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">手续费(%):</span>-->
<!--                <span class="account_item_content">{{form.brokerage==null||form.brokerage==""?'无':form.brokerage}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--            <div style="width:100%;border-bottom:1px solid #E4E7ED;margin-bottom:30px"></div>-->



<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">联系人:</span>-->
<!--                <span class="account_item_content">{{shopgetinfo.linkman}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">客服电话:</span>-->
<!--                <span class="account_item_content">{{shopgetinfo.phone}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">有效期至:</span>-->
<!--                <span class="account_item_content">{{shopgetinfo.expiredDate}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">账户年费:</span>-->
<!--                <span class="account_item_content">{{shopgetinfo.yearFee}}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="24">-->
<!--            <el-col :span="12">-->
<!--              <div class="account_item">-->
<!--                <span class="account_item_title">详细地址:</span>-->
<!--                <span class="account_item_content">{{ shopgetinfo.address }}</span>-->
<!--              </div>-->
<!--            </el-col>-->
<!--            <el-col :span="12">-->
<!--            </el-col>-->
<!--          </el-row>-->


          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="交易手续费:">
                <span style="display:inline-block;padding-left: 12px;">{{form.brokerage==null||form.brokerage==""?'无':form.brokerage}}</span>
                <span class="account_item_titleBotton margin-left" @click="updateBrokerageClick('transaction')">设置</span>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="平台服务费(%):">
                <span style="display:inline-block;padding-left: 12px;">{{form.paybill==null||form.paybill==""?'无':form.paybill}}</span>
<!--                <span class="account_item_titleBotton margin-left" @click="updateBrokerageClick">设置</span>-->
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="技术服务费:">
                <span style="display:inline-block;padding-left: 12px;"><em style="color: red">{{shopgetinfo.yearFee}}</em> {{'('+shopgetinfo.expiredDate+')'}} </span>
                <span class="account_item_titleBotton margin-left" @click="updateBrokerageClick('technical')">设置</span>
              </el-form-item>
            </el-col>
          </el-row>


          <div style="width:100%;border-bottom:1px solid #E4E7ED;margin-bottom:30px"></div>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="联系人:">
                <span style="width:235px;display:inline-block;padding-left: 12px;">{{shopgetinfo.linkman}}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="客服电话:" style="margin-left:20px">
                <span style="width:235px;display:inline-block;padding-left: 12px;">{{shopgetinfo.phone}}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="24">
<!--            <el-col :span="12">-->
<!--              <el-form-item label="有效期至:">-->
<!--                <span style="width:235px;display:inline-block;padding-left: 12px;">{{shopgetinfo.expiredDate}}</span>-->
<!--              </el-form-item>-->
<!--            </el-col>-->
            <el-col :span="12">
              <el-form-item label="详细地址:">
                <span style="width:235px;display:inline-block;padding-left: 12px;">{{ shopgetinfo.address }}</span>
              </el-form-item>
            </el-col>
          </el-row>


          <div style="width:100%;border-bottom:1px solid #E4E7ED;margin-bottom:30px"></div>
        </div>
        <el-form v-if="MuchShow==true" label-width="120px" ref="shopgetinfo" :model="shopgetinfo" :rules="rules">
            <!-- <div style="display:flex;margin-top:10px">
                <el-form-item label="账号类型">
                    <el-select style="width: 235px;" v-model="shopgetinfo.bankType" placeholder="请选择状态" @change="scopeTypechange">
                        <el-option label="对公账号" value="0"></el-option>
                        <el-option label="对私账号" value="1"></el-option>
                        <el-option label="支付宝账号" value="2"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item style="margin-left:5px" label="开户银行" v-if="shopgetinfo.bankType != 2">
                    <el-select style="width: 235px;" v-model="shopgetinfo.bankId" placeholder="请选择状态" @change="bankIdchange">
                        <el-option label="工商银行" value="8"></el-option>
                        <el-option label="交通银行" value="9"></el-option>
                        <el-option label="招商银行" value="10"></el-option>
                        <el-option label="民生银行" value="11"></el-option>
                        <el-option label="中信银行" value="12"></el-option>
                        <el-option label="浦发银行" value="13"></el-option>
                        <el-option label="兴业银行" value="14"></el-option>
                        <el-option label="光大银行" value="15"></el-option>
                        <el-option label="广发银行" value="17"></el-option>
                        <el-option label="平安银行" value="18"></el-option>
                        <el-option label="北京银行" value="26"></el-option>
                        <el-option label="华夏银行" value="28"></el-option>
                        <el-option label="农业银行" value="29"></el-option>
                        <el-option label="建设银行" value="30"></el-option>
                        <el-option label="邮政储蓄银行" value="31"></el-option>
                        <el-option label="中国银行" value="32"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item style="margin-left:5px" label="手续费(%)" v-if="shopgetinfo.bankType == 2">
                    <el-input placeholder="请输入手续费" type="number" v-model.trim="shopgetinfo.brokerage" style="width: 235px;" />
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item :label="shopgetinfo.bankType == 2?'支付宝号':'银行账号'">
                    <el-input :placeholder="shopgetinfo.bankType == 2?'请输入支付宝账号':'请输入账号'" v-model.trim="shopgetinfo.bankNum" style="width: 235px;" />
                </el-form-item>
                <el-form-item style="margin-left:5px" :label="shopgetinfo.bankType == 2?'姓名':'开户姓名'">
                    <el-input :placeholder="shopgetinfo.bankType == 2?'请输入姓名':'请输入开户名'" v-model="shopgetinfo.bankName" style="width: 235px;" />
                </el-form-item>
            </div>
            <el-form-item label="手续费(%)" v-if="shopgetinfo.bankType != 2">
                <el-input placeholder="请输入手续费" type="number" v-model.trim="shopgetinfo.brokerage" style="width: 235px;" />
            </el-form-item>

            <div style="width:100%;border-bottom:1px solid #E4E7ED;margin-bottom:20px"></div> -->
            <div style="display:flex;">
                <el-form-item label="联系人:" prop="linkman">
                    <el-col :span="12">
                        <el-input v-model="shopgetinfo.linkman" style="width:235px" />
                    </el-col>
                </el-form-item>
                <el-form-item style="margin-left:5px" label="客服电话:" prop="phone">
                    <el-input v-model="shopgetinfo.phone" style="width:235px" />
                </el-form-item>
            </div>
<!--            <div style="display:flex;">-->
<!--                <el-form-item label="有效期至:" prop="expiredDate">-->
<!--                    <el-col :span="6">-->
<!--                        <el-date-picker style="width:235px" v-model="shopgetinfo.expiredDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">-->
<!--                        </el-date-picker>-->
<!--                    </el-col>-->
<!--                </el-form-item>-->
<!--              <el-form-item style="margin-left:5px" label="账户年费:" prop="yearFee">-->
<!--                    <el-col :span="6">-->
<!--                        <el-input v-model="shopgetinfo.yearFee" style="width:235px" />-->
<!--                    </el-col>-->
<!--                </el-form-item>-->
<!--            </div>-->
            <el-form-item label="所在地址:">
                <el-col :span="12">
                    <Distpicker @selected="onSelected" :province="district.province" :city="district.city" :area="district.area" style=""></Distpicker>
                </el-col>
            </el-form-item>
            <el-form-item label="详细地址:">
                <el-input v-model="shopgetinfo.address" style="width:595px" />
            </el-form-item>
        </el-form>
        <el-dialog title="请选择具体位置" :visible.sync="mapShow" top="5vh" width="800px" :before-close="handleClose">
            <Map :initcenter="[shopgetinfo.lng, shopgetinfo.lat]" @getMap="getMap" />
            <span slot="footer" class="dialog-footer">
                <el-button @click="mapShow = false">取 消</el-button>
                <el-button type="primary" @click="savelngLat">确 定</el-button>
            </span>
        </el-dialog>
        <el-dialog title="店铺装修" :visible.sync="imagesShow">
            <el-button type="primary" @click="useimage">使用模板</el-button>
            <el-button type="primary" @click="voluntarily">自行上传</el-button>
            <div v-if="imgaesdialog == true" class="demo-image" style="
          margin-top: 20px;
          display: flex;
          justify-content: space-around;
          flex-wrap: wrap;
        ">
                <el-image v-for="(item, index) in images" :key="item" style="width: 100px; height: 100px" :src="item" @click="selectimage(index)"></el-image>
            </div>
            <single-upload v-if="imgaesdialog == false" :singleUploadTitle="singleUploadTitle" v-model="shopgetinfo.background" style="display: block; margin-left: 10px; margin-top: 30px"></single-upload>
            <span slot="footer" class="dialog-footer">
                <el-button type="primary" @click="determine">确定</el-button>
            </span>
        </el-dialog>
        <el-dialog title="账户信息管理" :visible.sync="dialogFormVisible" width="500px">
            <el-form :model="form" label-width="80px">
<!--                <el-form-item label="账户类型" >-->
<!--                    <el-select style="width: 100%;" v-model="form.bankType" placeholder="请选择状态" @change="scopeTypechange">-->
<!--                        <el-option label="对公账号" :value="0"></el-option>-->
<!--                        <el-option label="对私账号" :value="1"></el-option>-->
<!--                        <el-option label="支付宝账号" :value="2"></el-option>-->
<!--                    </el-select>-->
<!--                </el-form-item>-->
<!--                <el-form-item label="开户银行"  v-if="form.bankType != 2">-->
<!--                    <el-select style="width: 100%;" v-model="form.bankId" placeholder="请选择状态" @change="bankIdchange">-->
<!--                        <el-option label="工商银行" :value="8"></el-option>-->
<!--                        <el-option label="交通银行" :value="9"></el-option>-->
<!--                        <el-option label="招商银行" :value="10"></el-option>-->
<!--                        <el-option label="民生银行" :value="11"></el-option>-->
<!--                        <el-option label="中信银行" :value="12"></el-option>-->
<!--                        <el-option label="浦发银行" :value="13"></el-option>-->
<!--                        <el-option label="兴业银行" :value="14"></el-option>-->
<!--                        <el-option label="光大银行" :value="15"></el-option>-->
<!--                        <el-option label="广发银行" :value="17"></el-option>-->
<!--                        <el-option label="平安银行" :value="18"></el-option>-->
<!--                        <el-option label="北京银行" :value="26"></el-option>-->
<!--                        <el-option label="华夏银行" :value="28"></el-option>-->
<!--                        <el-option label="农业银行" :value="29"></el-option>-->
<!--                        <el-option label="建设银行" :value="30"></el-option>-->
<!--                        <el-option label="邮政储蓄银行" :value="31"></el-option>-->
<!--                        <el-option label="中国银行" :value="32"></el-option>-->
<!--                    </el-select>-->
<!--                </el-form-item>-->
<!--                <el-form-item  :label="form.bankType == 2?'支付宝号':'银行账号'">-->
<!--                    <el-input :placeholder="form.bankType == 2?'请输入支付宝账号':'请输入账号'" v-model.trim="form.bankNum" style="width: 100%;" />-->
<!--                </el-form-item>-->
<!--                <el-form-item  :label="form.bankType == 2?'姓名':'开户姓名'">-->
<!--                    <el-input :placeholder="form.bankType == 2?'请输入姓名':'请输入开户名'" v-model="form.bankName" style="width: 100%;" />-->
<!--                </el-form-item>-->

              <div v-if="dialogType == 'transaction'">
                <el-form-item  label="交易手续费(%)" label-width="120px" >
                  <el-input-number :precision="2" placeholder="请输入交易手续费（%）" :min="0" :max="100" type="number" v-model.trim="form.brokerage" style="width: 80%;" />
                </el-form-item>
                <el-form-item  label="平台服务费(%)" label-width="120px" >
                  <el-input-number :precision="2" placeholder="请输入平台服务费（%）" :min="0" :max="100" type="number" v-model.trim="form.paybill" style="width: 80%;" />
                </el-form-item>
              </div>

            <div v-if="dialogType == 'technical'">
              <el-form-item label="有效期至:" prop="expiredDate">
                  <el-date-picker style="width:235px" v-model="shopgetinfo.expiredDate" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
                  </el-date-picker>
              </el-form-item>
              <el-form-item style="margin-left:5px" label="账户年费:" prop="yearFee">
                  <el-input v-model="shopgetinfo.yearFee" style="width:235px" />
              </el-form-item>
            </div>



            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="cancelClick">取 消</el-button>
                <el-button type="primary" @click="saveClick">确 定</el-button>
            </div>
        </el-dialog>
        <storeInformation :MuchShow = MuchShow :shopgetinfo='shopgetinfo'></storeInformation>
    </div>
</template>
<script>
import storeInformation from "./storeInformation";
import { updateMchShop } from "@/api/sysSetUp";
import { update } from "@/api/sysMch";
import singleUpload from "@/components/Upload/singleUpload";
import permission from "@/directive/permission/index.js"; // 权限判断指令
import Map from "@/components/GaodeMap/index";
import Distpicker from "@/components/Distpicker/Distpicker";
import { getBalance, getParams, updateParams } from "@/api/enterprise";
import utils from "../../../utils/utils.js";
import { list as memberList } from '@/api/member'
import {EventBus} from "@/api/eventBus";
export default {
    components: { singleUpload, Map, Distpicker ,storeInformation},
    directives: { permission },
    props: {
        shopgetinfo: {
            type: Object,
        },
        MuchShow: {
            type: Boolean,
        },
        district: {
            type: Object,
        },
        mchId: {
            type: String,
        },
    },
    data() {
        return {

            memberId:'',
            memberList:'',
            dialogFormVisible: false,
            imagesShow: false,
            mapShow: false,
            loading: false, // 按钮防双击
            notice: "",
            singleUploadTitle: "200*200",
            lng: "",
            lat: "",
            address: "",
            formattedAddress: "",
            form: {
                brokerage: "",
                bankType: 0,
                bankId: "",
                bankNum: "",
                bankName: "",
              paybill:'',
            },
          dialogType:'',
          images: [
                "http://cdn.rzico.com/dinner/wode/picture/001.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/002.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/003.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/004.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/005.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/006.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/007.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/008.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/009.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/010.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/011.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/012.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/013.jpg",
                "http://cdn.rzico.com/dinner/wode/picture/014.jpg",
            ],
            imgaesdialog: true,
            codeImg: "",
            getBalanceAmount: 0,
            options: [
                {
                    value: "8",
                    label: "工商银行",
                },
                {
                    value: "9",
                    label: "交通银行",
                },
                {
                    value: "10",
                    label: "招商银行",
                },
                {
                    value: "11",
                    label: "民生银行",
                },
                {
                    value: "12",
                    label: "中信银行",
                },
                {
                    value: "13",
                    label: "浦发银行",
                },
                {
                    value: "14",
                    label: "兴业银行",
                },
                {
                    value: "15",
                    label: "光大银行",
                },
                {
                    value: "17",
                    label: "广发银行",
                },
                {
                    value: "18",
                    label: "平安银行",
                },
                {
                    value: "26",
                    label: "北京银行",
                },
                {
                    value: "28",
                    label: "华夏银行",
                },
                {
                    value: "29",
                    label: "农业银行",
                },
                {
                    value: "30",
                    label: "建设银行",
                },
                {
                    value: "31",
                    label: "邮政储蓄银行",
                },
                {
                    value: "32",
                    label: "中国银行",
                },
            ],
            rules: {
                linkman: [
                    {
                        required: true,
                        message: "请输入商户名称",
                        trigger: "blur",
                    },
                ],
                phone: [
                    {
                        required: true,
                        message: "请输入电话",
                        trigger: "blur",
                    },
                ],
            },
        };
    },
    watch: {
        mchId: {
            handler: function (val, oldVal) {
                console.log(val);
                if (val) {
                    this.getBalance(val);
                }
            },
            immediate: true,
            deep: true,
        },
      shopgetinfo: {
        handler: function (val, oldVal) {
          this.shopgetinfo = val
          this.getMchInfoClick()
        },
        immediate: true,
        deep: true,
      }


      },
    filters: {
        mchTypeFormatter(val) {
            if (val == 0) {
                return "对公账号";
            } else if (val == 1) {
                return "对私账号";
            }
        },
        bankIDtype(val) {
            if (val == 8) {
                return "工商银行";
            } else if (val == 9) {
                return "交通银行";
            } else if (val == 10) {
                return "招商银行";
            } else if (val == 11) {
                return "民生银行";
            } else if (val == 12) {
                return "中信银行";
            } else if (val == 13) {
                return "浦发银行";
            } else if (val == 14) {
                return "兴业银行";
            } else if (val == 15) {
                return "光大银行";
            } else if (val == 17) {
                return "广发银行";
            } else if (val == 18) {
                return "平安银行";
            } else if (val == 26) {
                return "北京银行";
            } else if (val == 28) {
                return "华夏银行";
            } else if (val == 29) {
                return "农业银行";
            } else if (val == 30) {
                return "建设银行";
            } else if (val == 31) {
                return "邮政储蓄银行";
            } else if (val == 32) {
                return "中国银行";
            }
        },
    },
    created() {
      this.loadMember('')
    },
    methods: {
      toAddMember() {
        this.memberVisible = true;
        this.times = new Date().getSeconds()
      },
      async  loadMember(query) {
        var _this = this
        let params = new URLSearchParams();
        params.append('keyword', query)
        await memberList(params).then(response => {
          console.log("这是客户信息");
          console.log(response);
          _this.memberList = response.data.data
          if(_this.memberList.length==0){
            this.memberphonetype=true
          }else{
            this.memberphonetype=false
          }
          if (_this.memberList.length > 4) {
            this.optionHeight = 'height:35px'
          } else {
            this.optionHeight = 'height:55px'
          }
        }).catch(error => {
          console.log('error!!')
        });
      },
      remoteMethod(query) {
        this.loadMember(query)
      },
      selectMember(data) {
        this.memberId = data.id;
        if(this.memberId  != ''){
          this.form.memberId = this.memberId
        }
      },


        onSelected(val) {
            console.log(val)
            console.log('12212121212121')
            if (!utils.isNull(val.area) && !utils.isNull(val.area.code)) {
                this.shopgetinfo.areaId = val.area.code;
                this.shopgetinfo.areaName = val.area.value;
            }
        },
        determine() {
            this.imagesShow = false;
        },
        useimage() {
            this.imgaesdialog = true;
        },
        voluntarily() {
            this.imgaesdialog = false;
        },
        selectimage(index) {
            this.shopgetinfo.background = this.images[index];
            this.imagesShow = false;
        },
        changesback() {
            this.imagesShow = !this.imagesShow;
        },
        getMap(lng, lat, address) {
            console.log(lng, lat);
            console.log(address);
            this.lng = lng;
            this.lat = lat;
            this.address = address.formattedAddress;
        },
        savelngLat() {
            this.shopgetinfo.lng = this.lng;
            this.shopgetinfo.lat = this.lat;
            this.shopgetinfo.address = this.address;
            updateMchShop(this.shopgetinfo)
                .then((res) => {
                    console.log(res);
                })
                .catch((err) => {
                    console.log(res);
                });
            this.mapShow = false;
        },
        handleClose(done) {
            this.$confirm("确认关闭？")
                .then((_) => {
                    done();
                })
                .catch((_) => {});
        },
        mapShowFn() {
            this.mapShow = !this.mapShow;
        },
        validateForm() {
            let flag = null;
            this.$refs["shopgetinfo"].validate((valid) => {
                if (valid) {
                    flag = true;
                } else {
                    flag = false;
                }
            });
            return flag;
        },
        getBalance(data) {
            var _this = this;
            getBalance({ mchId: data }).then((res) => {
              if(res.data != null){
                _this.getBalanceAmount = res.data;
              }
            });
        },
        bankIdchange(val) {
            console.log(val)
            this.shopgetinfo.bankId = val;
        },
        scopeTypechange(val) {
            this.shopgetinfo.bankType = val;
        },
        getMchInfoClick() {
          if(this.shopgetinfo.id != null){
            getParams({ mchId: this.shopgetinfo.id }).then((res) => {
              if(res.data != null){
                this.form = res.data;
              }
            });
          }
        },

        updateBrokerageClick(val) {
            this.dialogType = val
            var _this = this;
            _this.dialogFormVisible = true;
        },
        saveClick() {
          if(this.dialogType == 'transaction'){
            this.dialogFormVisible = false;
            let params = {
              id: this.form.id,
              paybill: this.form.paybill,
              brokerage: this.form.brokerage
            }
            updateParams(params).then((res) => {
              this.$message({
                message: "修改成功",
                type: "success"
              });
              this.getMchInfoClick()
            });
          }
          if(this.dialogType == 'technical'){
            this.dialogFormVisible = false;
            let params = {
              id:this.shopgetinfo.id,
              yearFee:this.shopgetinfo.yearFee,
              expiredDate:this.shopgetinfo.expiredDate
            }
            update(params).then((rse) => {
              this.$message({
                message: "修改成功",
                type: "success"
              });
            });
          }
        },
        cancelClick() {
            this.dialogFormVisible = false;
        },
        capitalClick() {
            this.$router.push({
                path: "/sysMch/capitalFlow",
                query: { mchId: this.shopgetinfo.mchId },
            });
        },

    },
};
</script>
<style  scoped>
/deep/.el-upload__tip {
    display: none;
}
.account_item {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 30px;
}

.account_item_title {
    font-size: 14px;
    color: #666666;
    width: 100px;
    display: block;
}

.account_item_content {
    font-size: 14px;
    color: #303133;
}

.account_item_titleBotton {
    color: #409eff;
    cursor: pointer;
    font-size: 14px;
    /*margin-left: 20px;*/
}





.account_item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin-bottom: 30px;
  margin-left: 50px;
}

.account_item_title {
  font-size: 14px;
  color: #606266;
  display: block;
}
.account_item_title_app {
  font-size: 14px;
  color: #606266;
  font-weight: 700;
  width: 140px;
}
.shop_img {
  width: 140px;
  height: 140px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  margin-left: 5px;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shop_img_notitle {
  font-size: 14px;
  color: #c0c4cc;
}
.account_conter_item {
  display: flex;
}
/deep/ label {
  font-weight: 400!important;
}
.margin-left{
  margin-left: 10px;
}
</style>
